home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / Input / IFOParser / tstifo.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-06  |  3.2 KB  |  125 lines

  1.  
  2. /*
  3.  *
  4.  * Copyright (C) 1998,1999  Thomas Mirlacher
  5.  *
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; either version 2 of the License, or
  9.  * (at your option) any later version.
  10.  * 
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  * 
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program; if not, write to the Free Software
  18.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  * 
  20.  * The author may be reached as dent@cosy.sbg.ac.at, or
  21.  * Thomas Mirlacher, Jakob-Haringerstr. 2, A-5020 Salzburg,
  22.  * Austria
  23.  *
  24.  *------------------------------------------------------------
  25.  *
  26.  */
  27.  
  28. #include "IFOParser.h"
  29. #include <stdio.h>
  30.  
  31. #include <io.h>
  32. #include <stdlib.h>
  33.  
  34. #include <sys/types.h>
  35. //#include <unistd.h>
  36. #include <fcntl.h>
  37.  
  38. #include "ifo.h"
  39. #include "misc.h"
  40.  
  41. extern void ifo_print_audiosub (u_char *ptr);
  42. extern void ifoPrintSPU        (ifo_spu_t *spu, u_int num);
  43. extern void ifoPrintAudio    (ifo_audio_t *audio, u_int num);
  44. extern void ifoPrintTMT        (ifo_t *ifo);
  45. extern void ifoPrint_ptt (ifo_ptt_t *ptt);
  46. extern void ifoPrint_vts_vobu_addr_map (ifo_t *ifo);
  47. extern void ifoPrint_vtsm_vobu_addr_map (ifo_t *ifo);
  48. extern void ifoPrint_vts_cell_addr (ifo_t *ifo);
  49. extern void ifoPrint_vtsm_cell_addr (ifo_t *ifo);
  50. extern void ifoPrint_title_pgci (ifo_t *ifo);
  51. extern void ifoPrintToast (u_char *toast);
  52. extern void ifoPrint_menu_pgci (ifo_t *ifo);
  53. extern void ifoPrint_pgc_cmd (u_char *pgc_ptr);
  54.  
  55.  
  56. /**
  57.  *
  58.  */
  59.  
  60. int my_main (int argc, char **argv)
  61. {
  62.    CIFOParser ifo;
  63.     TPGC *pgc;
  64.     int i;
  65.  
  66.    ifo.Load("matrix.ifo");
  67.  
  68.  
  69. /*    ifo_t *ifo;
  70.     int   fd;
  71.  
  72.     printf ("free InFormatiOn project %s\n", version);
  73.     printf ("--------------------------------\n");
  74.     printf ("(c) 1999-2000 by Thomas Mirlacher\n\n");
  75.  
  76.     if ((fd = open (argv[1], O_RDONLY|_O_BINARY)) < 0) {
  77.         fprintf (stderr, "error opening file %s.\n", argv[1]);
  78.         exit (-1);
  79.     }
  80.  
  81.     if (!(ifo = ifoOpen (fd, 0))) {
  82.         fprintf (stderr, "error initializing ifo.\n");
  83.         exit (-1);
  84.     }
  85.  
  86.     ifoPrintVideo (ifo->data[ID_MAT] + IFO_OFFSET_VIDEO);
  87.  
  88.     if (!ifoIsVTS (ifo)) {
  89.         char *ptr;
  90.         int num;
  91.  
  92.         if ((num = ifoGetAudio ((char *)ifo->data[ID_MAT] + IFO_OFFSET_AUDIO, &ptr)) > 0)
  93.             ifoPrintAudio ((ifo_audio_t *)ptr, num);
  94.  
  95.         if ((num = ifoGetSPU ((char *)ifo->data[ID_MAT] + IFO_OFFSET_SUBPIC, &ptr)) > 0)
  96.             ifoPrintSPU ((ifo_spu_t *)ptr, num);
  97.  
  98.         //ifoPrintSPU (ifoGetSPU (ifo->data[ID_MAT] + IFO_OFFSET_SUBPIC));
  99.  
  100.         ifoPrintTMT (ifo);
  101.  
  102.         ifoPrint_ptt (ifo_get_ptt (ifo));
  103.     }
  104.  
  105.     if (!ifoIsVMG (ifo)) {
  106.         ifo_print_audiosub (ifo->data[ID_TMT]);
  107.         ifoPrintToast (ifo->data[ID_PTT]);
  108.  
  109. //        ifoPrint_ptt (ifo_get_ptt (ifo));
  110.     }
  111.  
  112.     ifoPrint_title_pgci (ifo);
  113.  
  114.     ifoPrint_menu_pgci (ifo);
  115.     ifoPrint_vtsm_cell_addr (ifo);
  116.     ifoPrint_vtsm_vobu_addr_map (ifo);
  117.  
  118.     ifoPrint_vts_cell_addr (ifo);
  119.     ifoPrint_vts_vobu_addr_map (ifo);
  120.  
  121.     ifoClose (ifo);
  122. */
  123.     return 0;
  124. }
  125.